<?php /* Create Client Controller */
	require_once('modules/clients/actions/create/scripts/validate-client.php');
	if (isset($_POST['form-action'])) { //se envio formulario
		$validacion = validarCliente();
		if (!empty($validacion)) { //fallo validacion
			$arr_roles = $client->getRoles();
			require_once('modules/clients/actions/create/view/create-client.php');
		} else { //si valido correcto
			$user_id = $client->insert('usuarios');
			$client->set('clientes','fk_usuario',$user_id);
			$client->insert('clientes');
			require_once('modules/clients/actions/list/index.php');
		}
	} else { //pre-carga
		$arr_roles = $client->getRoles();
		$client->set('usuarios','pais','Argentina');
		$client->set('usuarios','idioma','es');
		$client->set('usuarios','huso_horario',-3);
		require_once('modules/clients/actions/create/view/create-client.php');
	}
?>